package com.rzn.reading.mapper;

import com.rzn.reading.entity.Attach;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface AttachMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Attach record);

    Attach selectByPrimaryKey(Integer id);

    List<Attach> selectAll();

    int updateByPrimaryKey(Attach record);

    int insertBatch(@Param("attaches") List<Attach> attaches);

    int relateAttach(@Param("ownerId") Integer ownerId, @Param("ownerName") String ownerName, @Param("ids") List<Integer> ids);

    List<Attach> selectByOwner(@Param("ownerId") Integer ownerId, @Param("ownerName") String ownerName, @Param("category") String category);

    int deleteByOwner(@Param("ownerId") Integer ownerId, @Param("ownerName") String ownerName, @Param("category") String category);

    Attach selectOne(@Param("ownerName") String ownerName, @Param("ownerId") Integer ownerId);

    List<Attach> selectByOwnerName(@Param("ownerName") String ownerName);
}